[codex] Refactor review and text generation services#3196
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🚀 Expo continuous deployment is ready!
|
ApprovabilityVerdict: Approved This PR contains mechanical refactoring changes - converting named imports to namespace imports and reorganizing type definitions. No runtime behavior is modified; the actual function implementations remain identical. You can customize Macroscope's approvability policy. Learn more. |
349a8f2 to
3d81b95
Compare
Dismissing prior approval to re-evaluate 3d81b95
3d81b95 to
874c228
Compare
Dismissing prior approval to re-evaluate 874c228
Co-authored-by: codex <codex@users.noreply.github.com>
874c228 to
7fe6a2e
Compare
Dismissing prior approval to re-evaluate 7fe6a2e
Summary
ReviewServiceandTextGenerationservice contracts inline on theirContext.Servicetags.makeandlayerexports without syntheticEffect.succeedwrappers.Service["Service"]types.TextGenerationServiceprovider contract.TextGenerationShapealias only for the excluded orchestration compatibility harness; this PR does not modify orchestration modules.Behavior
Provider-instance routing, review diff generation, and text-generation behavior are unchanged. This is a service-module organization and typing refactor.
Validation
vp check— passed; 20 pre-existing unrelated warningsvp run typecheck— passedNote
Low Risk
Import and typing refactors only; provider-instance routing and service behavior are unchanged, with broad test coverage noted in the PR.
Overview
This PR mechanically aligns the review and text-generation domains with the repo’s target Effect
Context.Servicepattern without changing routing or generation behavior.TextGenerationnow defines its API on the service tag itself (replacing a separateTextGenerationShapeinterface), builds registry-backed implementations viaTextGeneration.of, and exposes amakeeffect plus alayerwired asLayer.effect(TextGeneration, make). A deprecatedTextGenerationShapealias remains for legacy consumers.ReviewServicefollows the same move: the standalone shape type is removed,makeis a plainEffect.gen, and the layer references that effect directly.All provider implementations (Claude, Codex, Cursor, Grok, OpenCode) and
ProviderDrivernow satisfyTextGeneration.TextGeneration["Service"]instead of the old shape type. Tests and harnesses (GitManager,ProviderAdapterRegistry, text-generation tests, etc.) switch to namespace imports (* as Module) for services, config, GitHub CLI, and related helpers so tokens and errors are referenced in a consistent, module-qualified way.Reviewed by Cursor Bugbot for commit 7fe6a2e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Refactor text generation and review services to use namespace imports
ClaudeTextGeneration,CodexTextGeneration,CursorTextGeneration,GrokTextGeneration,OpenCodeTextGeneration) and theReviewService, aligning import style with Effect.js conventions.TextGenerationShapeinterface with an inlineContext.Service-basedTextGenerationclass; exportsTextGenerationShapeas a deprecated type alias for backward compatibility.makeeffect toTextGeneration.tsand simplifies the layer toLayer.effect(TextGeneration, make).ReviewServiceto inline its service shape viaContext.Servicegeneric and changesmakefrom a function returning an Effect to a plain Effect.GitManager.test.tsandProviderAdapterRegistry.test.tsto use namespaced service tokens (e.g.ServerConfig.ServerConfig.layerTest).Macroscope summarized 7fe6a2e.